//
//  ViewController.m
//  HeadTabView
//
//  Created by 吴浪 on 15/12/23.
//  Copyright © 2015年 吴浪. All rights reserved.
//

#import "ViewController.h"
#import "MainViewController.h"
#import "Masonry.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    btn.backgroundColor = [UIColor redColor];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.size.mas_offset(CGSizeMake(60.0, 50.0));
    }];
}

- (void)btnClick {
    MainViewController *mainVC = [[MainViewController alloc] init];
    mainVC.view.backgroundColor = [UIColor grayColor];
    UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:mainVC];
    navVC.navigationBarHidden = YES;
    [self presentViewController:navVC animated:YES completion:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
